home *** CD-ROM | disk | FTP | other *** search
- ç
- TYPE
- ªSwapProcedureª=PROCEDURE (LONGINT,LONGINT);
- (*
- * FUNCTION swap two elements of an array
- * Swaps two elements of an array.
- * INPUTS LONGINT = index of an element in the array
- * LONGINT = index of an element in the array
- *
- *)
- ç
- ç
- TYPE
- ªComparisonª=PROCEDURE (LONGINT,LONGINT) : BOOLEAN;
- (*
- * FUNCTION compare two elements
- * Compares two elements of an array.
- * INPUTS LONGINT = index of an element in the array
- * LONGINT = index of an element in the array
- * RESULTS TRUE if the comparison is TRUE else FALSE
- *
- *)
- ç
- ç
- PROCEDURE ªQuickSortª (first,last : LONGINT;
- Lower : ºComparisonº;
- Swap : ºSwapProcedureº;
- ascending : BOOLEAN);
- (*
- * FUNCTION sort an array
- * This implementation of the quicksort-algorythm is very
- * flexible. It sorts arrays of every type and the user can
- * choose if the array is sorted ascending or not. To make this
- * possible the user has to write two procedures. One that
- * compares two elements of the array and one that swaps two
- * elements.
- * INPUTS first = first index of the array
- * last = last index of the array
- * Lower = PROCEDURE which compares two elements of the array
- * returns TRUE if the first element of the comparison
- * is really lower (a<b) than the second element
- * Swap = PROCEDURE which swaps two elements of the array
- * ascending = if ascending is TRUE the first element of the
- * array will be the smallest and the last element
- * the greatest
- * if ascending is FALSE it will be vice versa
- * BUGS none known
- * AUTHOR Markus Uhlendahl
- *
- *)
- ç
-